This compressed file contains the code necessary to reproduce the results in “Learning Before 
Testing: A Selective Nonparametric Test for Conditional Moment Restrictions” 
by Jia Li, Zhipeng Liao, and Wenyu Zhou (2025).
This version: 12/01/2025

All simulations and empirical analysis are conducted using MATLAB R2021b.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Simulation: This folder contains all the simulation code used in the paper.

(1) Main_File_Simulation_Size_and_Power.m: generates the size results reported in Table 1 
and the power curves plotted in Figure 1 in the main text.

(2) Main_File_Bootstrap_Test.m: generates the data used for Figure S3 in the Online Appendix.

(3) Figures: This folder contains the code used to generate Figure 1 in the main text and 
Figure S1 in the Online Appendix.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Empirical Application: This folder contains all the code used to reproduce the results in 
the empirical application.

(1) Main_File_CEPA_2_Conditioning_Variables.m: implements the selective tests 
and produces Table 2 in the main text.

(2) Figure 1: This folder contains the code used to generate Figure 2 in the main text.

(3) oos forecast - window size 180 - 20221215: This folder contains the out-of-sample 
forecasts of monthly CPI.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

